<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var countVowelSubstrings = function (word) {
      let ans = 0
      label: for (let i = 0; i < word.length; i++) {
        let set = new Set()
        for (let j = i; j < word.length; j++) {
          if (!'aeiou'.includes(word[j])) continue label
          set.add(word[j])
          if (set.size === 5) ans++
        }
      }
      return ans
    };
    console.log(countVowelSubstrings(word = "aeiouu"))
  </script>
</body>

</html>